package com.ruoyi.common.enums;

/**
 * 编制
 * 
 * @author ruoyi
 */
public enum OrganType
{
    ADMIN("organ_admin", "行政"),
    SINGLE("organ_single", "单列"),
    WORK("organ_work", "工勤"),
    CAUSE("organ_cause", "事业");

    private final String code;
    private final String info;

    OrganType(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }


    public static OrganType organTypeOf(String code) {
        for(OrganType actionEnum : values()){
            if(actionEnum.getCode().equals(code)){
                return actionEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }
}
